const express = require('express')
const router = express.Router()
const { getRateInfo, deleteRate, rateCount, searchRate } = require('../../controller/apis/EvaluateController')

// 导入JWT拦截中间件
const checkTokenMiddleware = require('../../middlewares/checkTokenMiddleware')

// 获取用户的房源评价记录
router.get('/evaluate', checkTokenMiddleware, getRateInfo)

// 删除评论记录
router.delete('/evaluate/del/:id', checkTokenMiddleware, deleteRate)

// 获取用户评论总数
router.get('/evaluate/count', checkTokenMiddleware, rateCount)

// 搜索用户评论
router.get('/evaluate/search', checkTokenMiddleware, searchRate)

module.exports = router